// import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tiktokadult/assets_tool/images.dart';
import 'package:tiktokadult/hj_utils/widget_utils.dart';
import 'package:mobkit_dashed_border/mobkit_dashed_border.dart';

class AddMediaCoverButton extends StatelessWidget {
  Function() onTap;
  double width;
  double height;
  double radius;
  final Color borderColor;
  final Color backgroundColor;
  String? title;

  AddMediaCoverButton({
    super.key,
    required this.onTap,
    this.width = 111,
    this.height = 111,
    this.radius = 10,
    this.title,
    this.borderColor = const Color(0x3cffffff),
    this.backgroundColor = Colors.white,
  }) {
    title = "添加封面";
  }

  @override
  Widget build(BuildContext context) {
    return InkWell(
      child: Container(
        height: height,
        width: width,
        decoration: BoxDecoration(
            color: Color(0x0Dffffff),
            border: DashedBorder.fromBorderSide(
              dashLength: 2,
              side: BorderSide(color: borderColor, width: 1),
            ),
            borderRadius: BorderRadius.all(Radius.circular(radius))),
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Image.asset(
                'add_grey.png'.communityPath,
                width: 30,
                height: 30,
              ),
              9.sizeBoxH,
              Text(
                title!,
                style: TextStyle(
                  color: Colors.white.withOpacity(.6),
                  fontSize: 14.sp,
                ),
              ),
            ],
          ),
        ),
      ),
      onTap: onTap,
    );
  }
}
